home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16900 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  748 b 

  1. Path: digex.net!not-for-mail
  2. From: car@access4.digex.net (Mr. Blue)
  3. Newsgroups: comp.lang.c++
  4. Subject: STL: Finding an object in a set of Pointers
  5. Date: 12 Apr 1996 09:42:14 -0400
  6. Organization: Express Access Online Communications, Greenbelt, MD USA
  7. Message-ID: <4klmjm$kul@access4.digex.net>
  8. NNTP-Posting-Host: access4.digex.net
  9.  
  10.  
  11. I am using an STL set to contain *pointers* to objects.
  12.  
  13. Problem: I want to find out if an object I just created is
  14. logically contained in the set. 
  15.  
  16. The find() function will tell me whether the same *address*
  17. is already in the set, but I need to follow the pointers and
  18. invoke operator==() on the objects. 
  19.  
  20. Is there an elegant way I can do this without writing my
  21. own loop, de-referencing, and comparing?
  22.  
  23. Chris
  24.  
  25.  
  26.